home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7789 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: vmsnet.misc,comp.lang.c
  4. Subject: Re: How to run a C program taking command line arguments on VMS
  5. Date: 28 Feb 1996 23:27:38 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Distribution: world
  8. Message-ID: <4h2oda$n7q@gap.cco.caltech.edu>
  9. References: <4h1u5d$s5c@news.fsu.edu>
  10. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  11. NNTP-Posting-Host: sol1.gps.caltech.edu
  12.  
  13. In article <4h1u5d$s5c@news.fsu.edu>, meil@firnvx.firn.edu (Lynn Mei) writes:
  14. =Could someone tell me how to run a C program which takes command line 
  15. =arguments on VAX/VMS? I have checked the FAQ about openVMS and tried the 
  16. =instructions. But I couldn't get it work. I don't have an openVMS mannual.  
  17. =Please help me!
  18. =
  19. =My program is like:
  20. =
  21. =/* myprog.c */
  22. =  
  23. =  main(argn, **argv)
  24. =  {
  25. =  
  26. =     ...
  27. =
  28. =  }
  29. =
  30. =If run on Unix or DOS, I could type something like
  31. =
  32. =  myprog -lu abcd
  33. =
  34. =How to run it on VMS?
  35. =
  36. =I'd appreciate your help!
  37.  
  38. From the FAQ which you claim to have read:
  39. ------------------------------------------------------------
  40. DCL1.   How do I run a program with arguments?
  41.  
  42. The RUN command does not accept arguments.  To pass arguments to a program,
  43. you must use what is called a "foreign command".  For example:
  44.  
  45.     $ uudecode :== $disk:[dir]uudecode.exe
  46.     $ uudecode filespec
  47.  
  48. The leading $ in the symbol definition is what makes it a foreign command.
  49. If the device and directory is omitted, SYS$SYSTEM: is assumed.  For more
  50. information on foreign commands, see the OpenVMS User's Manual.
  51.  
  52. See also question PROG2.
  53.  
  54. If you want to create a detached process that takes arguments from a command
  55. line, it must be run under the control of a command line interpreter
  56. (typically DCL).  This is done by placing the command line in a file,
  57. specifying SYS$SYSTEM:LOGINOUT.EXE as the image to run and the command file
  58. as the input.  For example:
  59.  
  60.     $ OPEN/WRITE CMD TEMP_INPUT.COM
  61.     $ WRITE CMD "$ MYCOMMAND arguments"
  62.     $ CLOSE CMD
  63.     $ RUN/DETACHED SYS$SYSTEM:LOGINOUT /INPUT=TEMP_INPUT.COM
  64.  
  65. ------------------------------------------------------------
  66. --------------------------------------------------------------------------------
  67. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  68.  
  69. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  70. understanding of astronomy is purely at the amateur level (or below).  So
  71. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  72. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  73. hold me responsible for it, but my organization had nothing to do with it.
  74.